package com.jswlw.service.biz.impl;

import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.jswlw.dao.biz.FilterInfoMapper;
import com.jswlw.entity.biz.FilterInfo;
import com.jswlw.service.biz.FilterInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author 吴维斌 E-mail:wuweibin0817@163.com
 * @version 创建时间：${date} ${time}
 */
@Service
public class FilterInfoServiceImpl implements FilterInfoService {
    @Autowired
    FilterInfoMapper mapper;

    @Override
    public void add(FilterInfo filterInfo) {
        mapper.insert(filterInfo);
    }

    @Override
    public void update(FilterInfo filterInfo) {
        mapper.updateByPrimaryKeySelective(filterInfo);
    }

    @Override
    public void delete(int id) {
        mapper.deleteByPrimaryKey(id);
    }

    @Override
    public FilterInfo find4Id(int id) {
        return mapper.selectByPrimaryKey(id);
    }

    @Override
    public List<FilterInfo> queryList(FilterInfo filter) {
        return mapper.queryList(filter);
    }

    @Override
    public Page<FilterInfo> queryPage(FilterInfo filter, int pageNum, int pageSize) {
        PageHelper.startPage(pageNum,pageSize);
        return (Page<FilterInfo>) mapper.queryList(filter);
    }
}
